package com.atguigu.com.search.controller;

import com.atguigu.com.search.service.MallSearchService;
import com.atguigu.com.search.vo.RequestParm;
import com.atguigu.com.search.vo.ResponseParm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class SearchController {

    @Autowired
    MallSearchService searchService;

    @GetMapping("/list.html")
    public String search(RequestParm requestParm, Model model){

        ResponseParm responseParm = searchService.search(requestParm);
        model.addAttribute("result",responseParm);
        return "list";
    }
}
